package com.salmon.security.core.authorization.impl;

import com.salmon.security.core.authorization.AuthorizeConfigProvider;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;

/**
 * 所有请求都需要身份认证的实现，需要根据具体的情况自行注入，注意AuthorizeConfigProvider的注入顺序，一定要放到最有一个
 */
public class AnyRequestAuthenticatedAuthorizeConfigProvider implements AuthorizeConfigProvider {
    @Override
    public void config(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry config) {
        config.anyRequest().authenticated();
    }
}
